﻿<%@LANGUAGE="VBSCRIPT" %>
<html>
<head>

<script type="text/javascript">
<%

'Stores only files with size less than MaxFileSize


Dim DestinationPath
DestinationPath = Server.mapPath("TempScriptImport")

'Create upload form
'Using Huge-ASP file upload
'Dim Form: Set Form = Server.CreateObject("ScriptUtils.ASPForm")
'Using Pure-ASP file upload
Dim Form: Set Form = New ASPForm
Dim Success: Success = 0
Dim ErrorMsg: ErrorMsg = ""

Server.ScriptTimeout = 2000
Form.SizeLimit = &H100000

If Form.State = 0 Then 'Completed
	Form.Files.Save DestinationPath 

	Response.Write "location.href='AdminScriptEditorImport.asp?filename=" & Form.Item(1).FileName & "';"

ElseIf Form.State > 10 then

	Const fsSizeLimit = &HD

	Select case Form.State
		case fsSizeLimit: ErrorMsg = "submitted file size of " & CInt(Form.TotalBytes / 1024) & "KB exceeds the submission limit of " & CInt(Form.SizeLimit / 1024) & "KB"

		case else ErrorMsg = "Unknown error while trying to upload"

	end Select

	Response.Write	"var response = {Success:" & Success & ", ErrorMsg:""" & ErrorMsg & """};" & _
					"parent.AdminScriptEditor.ImportDialogOnComplete(response);"

End If'Form.State = 0 then



'Response.Write(ResponseObj)

%>
<!--#INCLUDE FILE="Includes/_upload.asp"-->

</script>

</head>
<body></body>
</html>
